Call by Value
The type of parameter passing that Java uses is called
call by value.
Some programming languges use other methods of parameter passing,
and some give the programmer a choice amoung several ways to
pass parameters.
The call by value method that Java uses is the most
common method in modern languages and is the easiest and safest.
This is how call by value works:
- When the caller invokes a method, the caller provides a list of values
(the actual parameters) in the parameter list.
- When the invoked method starts up these values are "bound" to a list of
names (the formal parameters.)
- The invoked method uses these names to "stand for" the actual values.
- The invoked method cannot use the parameters to send a value back to the caller.